(function () {

    var BASE_URL = 'http://yydcnjjw.top/zebra/';
    var DOWNLOAD_URL = BASE_URL + 'download?rootDir=';
    var cardList;

    var cardImage = document.getElementsByClassName('classify-list-img');
    var cardContent = document.getElementsByClassName('classify-list-intro');
    ajax({
        method: 'POST',
        url: 'http://yydcnjjw.top/zebra/CardsWithCountry',
        data: {
            page: '0',
            maxPage: '6'
        },
        success: function (response) {
            console.log(response);
            cardList = response.data;
            for(var i = 0 ; i < cardImage.length; i++){
                var imgStr = cardList[0].card.img;
                var imgArray = imgStr.split(';');
                cardImage[i].style.backgroundImage = 'url('+DOWNLOAD_URL+imgArray[0]+')';
                cardContent[i].innerHTML = cardList[0].card.content;
                console.log(DOWNLOAD_URL+imgArray[0]);
            }
        }
    });

})();